<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h1 {
            color: red;
        }
    </style>
</head>

<body>
    <h1></h1>
    <h2></h2>
    <h3></h3>
    <script>
        const names = ['周杰伦', '刘德华', '蔡徐坤', '张学友', '黎明', '刘老师']
        let num1 = Math.floor(Math.random() * 6)
        let a = names[num1]
        names.splice(num1, 1)
        let num2 = Math.floor(Math.random() * 5)
        let b = names[num2]
        names.splice(num2, 1)
        let num3 = Math.floor(Math.random() * 4)
        let c = names[num3]
        names.splice(num3, 1)
        const h1 = document.querySelector('h1')
        document.write(h1.innerHtml = `<h1>一等奖:${a}</h1>`)
        document.write(h1.innerHtml = `<h2>二等奖:${b}</h2>`)
        document.write(h1.innerHtml = `<h3>三等奖:${c}</h3>`)

    </script>
</body>

</html>